-
Notifications
You must be signed in to change notification settings - Fork 32
🎨 New rpc client in the api-server to avoid cross-service calls with the web-server variants (🚨)
#8431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎨 New rpc client in the api-server to avoid cross-service calls with the web-server variants (🚨)
#8431
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8431 +/- ##
==========================================
- Coverage 87.94% 87.72% -0.23%
==========================================
Files 1976 1984 +8
Lines 77240 77441 +201
Branches 1343 1344 +1
==========================================
+ Hits 67932 67938 +6
- Misses 8903 9098 +195
Partials 405 405
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
🧪 CI InsightsHere's what we observed from your CI run for cbf77c2. ✅ Passed Jobs With Interesting Signals
|
f738124 to
cc41ab4
Compare
api-server to avoid cross-service calls with the web-server variants
api-server to avoid cross-service calls with the web-server variantsapi-server to avoid cross-service calls with the web-server variants
8da9af1 to
db68e64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider my comment regarding casting, I think we can do better there.
Thanks!
services/web/server/src/simcore_service_webserver/application_settings.py
Show resolved
Hide resolved
packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/webserver/v1/api_keys.py
Outdated
Show resolved
Hide resolved
fd4d912 to
c8d44e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @pcrespov
64e97cc to
bfa9879
Compare
|
…h the web-server variants (🚨) (#8431) Co-authored-by: Mads Bisgaard <[email protected]>
…h the web-server variants (🚨) (#8431) Co-authored-by: Mads Bisgaard <[email protected]>



What do these changes do?
This PR introduces a new RPC client namespace configurable and restrict unintended cross-service calls. This is for now only used in the RPC communication between the
api-server(client) and thewb-api-server(server)Motivation
The

simcore_service_webserverpackage is reused across many services (wb-api-server,wb-auth,wg-garbage-collector,wg-listener, …). This package defines an RPC server under a fixed namespace (WEBSERVER_RPC_NAMESPACE). See in the image below RPC server (4) and RPC clients (1,2,3):Because all services share this namespace, a client can unintentionally reach any of them.
api-servershould only talk towb-api-server, but may end up reachingwebserveror others.Changes
RPCClientthat allows setting the RPC server namespace.WEBSERVER_RPC_NAMESPACEin the app settings:api-server→wb-api-serverpayments&directorv2→webserver(stills use the old method)wb-auth,wg-garbage-collector,wg-listener).RPCClientimplementation under:packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/webserver/v1Next Steps
webserverRPC client and use new everywhere #8448Related issue/s
How to test
Update from @bisgaard-itis:
I tested this by running the stack locally and checking that I can run functions via the api-server function interface. I.e. the first call to trigger the celery tasks. Then I scaled the
wb-api-serverto 0 replicas in portainer and checked, that the function interface was completely broken. Then I did the opposite: Scaled thewb-api-serverback to 1 and scaled theweb-serverto 0. With this, the frontend of course was broken and I checked that I could still run functions via the api-server. This proves that the api-server now sends its RPC requests to thewb-api-serverand not thewebserver.Dev-ops
WB_API_WEBSERVER_HOSTforWEBSERVER_RPC_NAMESPACE: ${WB_API_WEBSERVER_HOST}